layui.use(['form','layer','table','laytpl','util'],function(){
    var form = layui.form,
        layer = parent.layer === undefined ? layui.layer : top.layer,
        $ = layui.jquery,
        laytpl = layui.laytpl,
        table = layui.table,
        util = layui.util;

    load();
    function load(){
        var width = document.documentElement.clientWidth;
        if(/Android|webOS|iPhone|iPad|UC|BlackBerry/i.test(navigator.userAgent)) {
            var baseSize = 75;
            const scale = document.documentElement.clientWidth / 750;
            var fontSize = baseSize * Math.min(scale, 2);
            $("html").attr("style","font-size: "+parseFloat(fontSize).toFixed(1)+"px;");
            $("html").attr("data-dpr","1");
            $(".swiper-slide").attr("style","width: "+((width/3)-20)+"px; margin-right: 20px;");
            $(".swiper-wrapper").attr("style","transform: translate3d(0px, 0px, 0px); transition-duration: 300ms;");
        } else {
            var baseSize = 123;
            const scale = document.documentElement.clientWidth / 1920;
            var fontSize = baseSize * Math.min(scale, 2);
            $("html").attr("style","font-size: "+parseFloat(fontSize).toFixed(1)+"px;");
            $("html").attr("data-dpr","1");
            $(".swiper-slide").attr("style","width: 373.333px; margin-right: 20px;");
            $(".swiper-wrapper").attr("style","transform: translate3d(0px, 0px, 0px); transition-duration: 300ms;");


        }
    }

    $(".tokenReg").click(function(){
        window.location.href = "/reg";
    });
    $(".tokenLogin").click(function(){
        window.location.href = "/login";
    });
    $(".tokenIndex").click(function(){
        window.location.href = "/";
    });

    $(".clickMenu").click(function(){
        if ($(".clickMenu").attr("data-is")==0) {
            $(".menuItem").attr("style","height: calc(100vh - 84px);");
            var html='<div class="nav-lines nav-lines-1"></div><div class="nav-lines nav-lines-2"></div><div class="nav-lines nav-lines-3"></div>';
            $(".clickMenu").html(html);
            $(".clickMenu").attr("data-is",1)
        }else{
            $(".menuItem").attr("style","height: 0px;");
            var html='<div class="nav-lines"></div><div class="nav-lines"></div><div class="nav-lines"></div>';
            $(".clickMenu").html(html);
            $(".clickMenu").attr("data-is",0)
        }
    });

})
